package org.example.hospital_frontend.common;

import lombok.Data;

@Data
public class ResultUtils {
    public static <T> BaseResponse<T> success(T data){
        return new BaseResponse<>("success!",data,0);
    }
    public static <T>BaseResponse<T> fail(int code,String msg){
        return new BaseResponse<>(msg,null,code);
    }

    public static  <T>BaseResponse<T> fail(ErrorCode e){
        return new BaseResponse<>(e.getMsg(),null,e.getCode());
    }

}
